import Sprite = Laya.Sprite;

export default class Prop extends Laya.Sprite {
    public diamonds;
    public key;

    constructor(){
        super()
       
  
    }

    /**
     * 生成钻石
     */
    generateDiamonds( x:number,y:number ) {
        this.diamonds = new Sprite
        this.diamonds.loadImage("images/6.png")
        Laya.stage.addChild(this.diamonds);
        this.diamonds.x = x;
        this.diamonds.y = y;
        this.diamonds.width = 60
        this.diamonds.height = 60
        this.diamonds.pivotX = 30
        this.diamonds.pivotY = 30
        this.diamonds.name = "diamonds"
        return this.diamonds;
    }

    /**
     * 生成钥匙道具
     */
    generateKey( x:number,y:number ) {
        this.key = new Sprite
        this.key.loadImage("images/key.png")
        Laya.stage.addChild(this.key);
        this.key.x = x;
        this.key.y = y;
        this.key.width = 60
        this.key.height = 60
        this.key.pivotX = 30
        this.key.pivotY = 30
        this.key.name = "key"
        return this.key;
    }
    
}